package com.garlicts.framework.rpc;

import com.garlicts.framework.annotation.Bean;
import com.garlicts.framework.core.Initialization;

@Bean
public class RpcServerInitializer implements Initialization {

    @Override
    public void init() {
        RpcServer rpcServer = new RpcServer();
        new RpcServerThread(rpcServer).start();
    }

    class RpcServerThread extends Thread {

        RpcServer rpcServer;

        RpcServerThread(RpcServer rpcServer){
            this.rpcServer = rpcServer;
        }

        @Override
        public void run() {
            rpcServer.start();
        }

    }

}
